import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  // 选中增加active样式
  linkActiveClass: 'active',
  routes: [
    // 重定向
    {
      path: '/',
      redirect: '/Home',
      meta: {}
    },
    // home页面路由
    {
      path: '/Home',
      name: 'Home',
      redirect: '/Home/HomeContent',
      component: (resolve) => require(['@/pages/home/home.vue'], resolve),
      children: [
        // 首页内容路由
        {
          path: '/Home/HomeContent',
          name: 'HomeContent',
          component: (resolve) => require(['@/pages/home/home_content/home_content.vue'], resolve)
        },
        // 文章详情页面路由
        {
          path: '/Home/ArticleContent',
          name: 'ArticleContent',
          component: (resolve) => require(['@/pages/home/article_content/article_content.vue'], resolve)
        },
        // 关于本台页面路由 about_content
        {
          path: '/Home/AboutContent',
          name: 'AboutContent',
          component: (resolve) => require(['@/pages/home/about_content/about_content.vue'], resolve)
        }
      ]
    }
  ]
})
